import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import youkeList from '../pages/youke/list'
import youkeDetail from '../pages/youke/detail'
import youkeAdd from '../pages/youke/add'
import changdileixingList from '../pages/changdileixing/list'
import changdileixingDetail from '../pages/changdileixing/detail'
import changdileixingAdd from '../pages/changdileixing/add'
import changdixinxiList from '../pages/changdixinxi/list'
import changdixinxiDetail from '../pages/changdixinxi/detail'
import changdixinxiAdd from '../pages/changdixinxi/add'
import changdiyuyueList from '../pages/changdiyuyue/list'
import changdiyuyueDetail from '../pages/changdiyuyue/detail'
import changdiyuyueAdd from '../pages/changdiyuyue/add'
import xiangmufenleiList from '../pages/xiangmufenlei/list'
import xiangmufenleiDetail from '../pages/xiangmufenlei/detail'
import xiangmufenleiAdd from '../pages/xiangmufenlei/add'
import youwanxiangmuList from '../pages/youwanxiangmu/list'
import youwanxiangmuDetail from '../pages/youwanxiangmu/detail'
import youwanxiangmuAdd from '../pages/youwanxiangmu/add'
import youwanyuyueList from '../pages/youwanyuyue/list'
import youwanyuyueDetail from '../pages/youwanyuyue/detail'
import youwanyuyueAdd from '../pages/youwanyuyue/add'
import sheshifenleiList from '../pages/sheshifenlei/list'
import sheshifenleiDetail from '../pages/sheshifenlei/detail'
import sheshifenleiAdd from '../pages/sheshifenlei/add'
import gongyuansheshiList from '../pages/gongyuansheshi/list'
import gongyuansheshiDetail from '../pages/gongyuansheshi/detail'
import gongyuansheshiAdd from '../pages/gongyuansheshi/add'
import sheshiweihuList from '../pages/sheshiweihu/list'
import sheshiweihuDetail from '../pages/sheshiweihu/detail'
import sheshiweihuAdd from '../pages/sheshiweihu/add'
import youketongjiList from '../pages/youketongji/list'
import youketongjiDetail from '../pages/youketongji/detail'
import youketongjiAdd from '../pages/youketongji/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'youke',
					component: youkeList
				},
				{
					path: 'youkeDetail',
					component: youkeDetail
				},
				{
					path: 'youkeAdd',
					component: youkeAdd
				},
				{
					path: 'changdileixing',
					component: changdileixingList
				},
				{
					path: 'changdileixingDetail',
					component: changdileixingDetail
				},
				{
					path: 'changdileixingAdd',
					component: changdileixingAdd
				},
				{
					path: 'changdixinxi',
					component: changdixinxiList
				},
				{
					path: 'changdixinxiDetail',
					component: changdixinxiDetail
				},
				{
					path: 'changdixinxiAdd',
					component: changdixinxiAdd
				},
				{
					path: 'changdiyuyue',
					component: changdiyuyueList
				},
				{
					path: 'changdiyuyueDetail',
					component: changdiyuyueDetail
				},
				{
					path: 'changdiyuyueAdd',
					component: changdiyuyueAdd
				},
				{
					path: 'xiangmufenlei',
					component: xiangmufenleiList
				},
				{
					path: 'xiangmufenleiDetail',
					component: xiangmufenleiDetail
				},
				{
					path: 'xiangmufenleiAdd',
					component: xiangmufenleiAdd
				},
				{
					path: 'youwanxiangmu',
					component: youwanxiangmuList
				},
				{
					path: 'youwanxiangmuDetail',
					component: youwanxiangmuDetail
				},
				{
					path: 'youwanxiangmuAdd',
					component: youwanxiangmuAdd
				},
				{
					path: 'youwanyuyue',
					component: youwanyuyueList
				},
				{
					path: 'youwanyuyueDetail',
					component: youwanyuyueDetail
				},
				{
					path: 'youwanyuyueAdd',
					component: youwanyuyueAdd
				},
				{
					path: 'sheshifenlei',
					component: sheshifenleiList
				},
				{
					path: 'sheshifenleiDetail',
					component: sheshifenleiDetail
				},
				{
					path: 'sheshifenleiAdd',
					component: sheshifenleiAdd
				},
				{
					path: 'gongyuansheshi',
					component: gongyuansheshiList
				},
				{
					path: 'gongyuansheshiDetail',
					component: gongyuansheshiDetail
				},
				{
					path: 'gongyuansheshiAdd',
					component: gongyuansheshiAdd
				},
				{
					path: 'sheshiweihu',
					component: sheshiweihuList
				},
				{
					path: 'sheshiweihuDetail',
					component: sheshiweihuDetail
				},
				{
					path: 'sheshiweihuAdd',
					component: sheshiweihuAdd
				},
				{
					path: 'youketongji',
					component: youketongjiList
				},
				{
					path: 'youketongjiDetail',
					component: youketongjiDetail
				},
				{
					path: 'youketongjiAdd',
					component: youketongjiAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
